<template>
  <a-page-header
      style="background-color: rgb(235, 237, 240);"
      :breadcrumb="{ routes }"
  />
</template>

<script setup lang="ts">
import {useRoute} from 'vue-router';
import { computed } from 'vue';

// 获取当前路由
const route = useRoute();


// 计算面包屑路径
const routes = computed(() => {
  const routesMap = {
    'dashboard': '查看仪表盘',
    'course-list': '课程列表',
    'publish-homework': '发布作业',
    'homework-management': '作业管理',
    'student-list': '学生列表',
    'student-performance': '学生成绩',
    'profile-settings': '个人设置',
    'system-settings': '系统设置',
  };
  console.log(route.matched.map(record => ({
    path: record.path,
    breadcrumbName: routesMap[record.name] || record.name,
  })))
  return route.matched.map(record => ({
    path: record.path,
    breadcrumbName: routesMap[record.name] || record.name,
  }));
});


</script>

<style scoped>

</style>
